package com.sc.es.common;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.List;

/**
 * @author sc
 * Created on  2018/2/7
 */
@Data
@AllArgsConstructor
public class ServiceResult<T> {
    private long total;
    private List<T> result;

    public ServiceResult(T t){
        this.result= (List<T>) t;
        this.total=((List<T>) t).size();
    }

    public int getResultSize(){
        if(result.isEmpty()){
            return 0;
        }
        return result.size();
    }
}
